/**
* <b>Description:</b><br> 
* @author Reading.Reagan</a>
* @version 1.0
* @Note
* <b>ProjectName:</b> member
* <br><b>PackageName:</b> com.jingyanzi.client
* <br><b>ClassName:</b> package-info
* <br><b>Date:</b> 2018年9月28日 下午3:12:08
*/
package com.jingyanzi.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.jingyanzi.marketing.domain.PresentDo;
import com.jingyanzi.marketing.result.ResultDO;
import com.jingyanzi.marketing.result.ResultSupport;
import com.jingyanzi.marketing.service.IPresentService;


@RestController
@RequestMapping("/api")
public class PresentCientImpl {
	@Autowired
	private IPresentService presentService;

	@GetMapping("/present/{id}")
	public PresentDo get(@PathVariable(value = "id") Integer id) {
		ResultDO result = presentService.get(id);
		return (PresentDo) result.getModel(ResultSupport.FIRST_MODEL_KEY);
	}
	
	@PutMapping("/present")
	public void edit(@RequestBody PresentDo domain) {
		presentService.modifi(domain);
	}
	
}